<!-- 
 需求需要此页面废弃
 -->
<template>
	<view>
		<page-head :title="'驾考教练平台'" :headtype="1"></page-head>
		<view class="topblock">
			<image class="topbg" :src="apifun.serveimg+'hometbg.png'" mode="widthFix"></image>
			<view class="topmain">
				<view class="headmsg flex marginAuto">
					<view class="headmsgavatar">
						<image v-if="!teammsg.avatar" :src="apifun.serveimg+'headav.png'" mode=""></image>
						<image v-if="teammsg.avatar" :src="apifun.URLimg+teammsg.avatar" mode=""></image>
						<view class="leader mainBg baiColor" v-if="teammsg.is_team_leader == 1">团队长</view>
					</view>
					<view class="headmsgmain">
						<view class="headmsgmt flex">
							<view class="headmsgmt-name">{{ teammsg.username }}</view>
							<view class="headmsgmtx flex" v-if="teammsg.school_name">
								<view class="headmsgmtxl mainBg">
									<image :src="apifun.serveimg+'cardicon.png'" mode=""></image>
								</view>
								<view class="headmsgmtxr">{{ teammsg.school_name }}</view>
							</view>
						</view>
						<view class="headmsgmphone">{{ teammsg.mobile }}</view>
						<view class="headmsgmtd mainColor flex">
							<image class="headmsgmtdicon" :src="apifun.serveimg+'cardicon2.png'" mode=""></image>
							<view class="headmsgmtdname">{{ teammsg.team }}</view>
						</view>
					</view>
				</view>
				<view class="trainee marginAuto flex">
					<view class="traineeeach">
						<view class="traine-num">{{ teammsg.service_user }}</view>
						<view class="traine-tile">总服务学员</view>
					</view>
					<view class="traineeeach">
						<view class="traine-num">{{ teammsg.current_user }}</view>
						<view class="traine-tile">当前学员</view>
					</view>
				</view>
				<view class="order marginAuto">
					<view class="ordertop flex" @click="tabnavigate('/pages/tabbar/order')">
						<view class="ordertopl flex">
							<image class="ordertoplicon" :src="apifun.serveimg+'ordericon.png'" mode=""></image>
							<view class="ordertopltitle">教学订单</view>
						</view>
						<view class="ordertopr">全部></view>
					</view>
					<view class="ordermain marginAuto flex">
						<view class="traineeeach">
							<view class="traine-num">{{ teammsg.no_settle }}</view>
							<view class="traine-tile">待结算订单</view>
						</view>
						<view class="traineeeach">
							<view class="traine-num">{{ teammsg.has_settle }}</view>
							<view class="traine-tile">已结算订单</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="coach marginAuto">
			<view class="ordertopic"></view>
			<view class="ordertop flex" @click="tabnavigate('/pages/tabbar/team')">
				<view class="ordertopl flex">
					<view class="ordertopltitle">团队教练</view>
				</view>
				<view class="ordertopr">全部></view>
			</view>
			<view class="ordermain marginAuto flex">
				<view class="traineeeach">
					<view class="traine-num">{{ teammsg.total_coach }}</view>
					<view class="traine-tile">合计</view>
				</view>
				<view class="traineeeach" @click="navigate('/pages/home/authentication')" v-if="usermsg.is_team_leader != 1">
					<view class="traine-num">{{ teammsg.not_pay_coach }}</view>
					<view class="traine-tile">待认证</view>
				</view>
				<view class="traineeeach" v-if="usermsg.is_team_leader == 1">
					<view class="traine-num">{{ teammsg.not_pay_coach }}</view>
					<view class="traine-tile">待认证</view>
				</view>
				<view class="traineeeach" v-if="usermsg.is_team_leader == 1">
					<view class="traine-num">{{ teammsg.pay }}</view>
					<view class="traine-tile">待交保证金</view>
				</view>
				<view class="traineeeach">
					<view class="traine-num">{{ teammsg.pay_coach }}</view>
					<view class="traine-tile">已开通</view>
				</view>
			</view>
		</view>
		<view class="coach marginAuto">
			<view class="ordertopic"></view>
			<view class="ordertop flex">
				<!-- @click="navigate('/pages/my/invitelist')" -->
				<view class="ordertopl flex">
					<view class="ordertopltitle">团队成员</view>
				</view>
				<view class="ordertopr">先学后付暂未开通></view>
			</view>
			<view class="ordermain marginAuto flex">
				<view class="traineeeach">
					<view class="traine-num">{{ teammsg.one }}</view>
					<view class="traine-tile">科目一</view>
				</view>
				<view class="traineeeach">
					<view class="traine-num">{{ teammsg.two }}</view>
					<view class="traine-tile">科目二</view>
				</view>
				<view class="traineeeach">
					<view class="traine-num">{{ teammsg.three }}</view>
					<view class="traine-tile">科目三</view>
				</view>
				<view class="traineeeach">
					<view class="traine-num">{{ teammsg.four }}</view>
					<view class="traine-tile">科目四</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				apifun:this.apifun,
				usermsg:{},
				teammsg:{},
			};
		},
		onLoad() {
			this.teamdatafun();
			this.usermsgfun();
		},
		methods: {
			teamdatafun(){
				this.apifun.unirequest('/coach/user/getTeamInfo','post',{},(res)=>{
					if(res.code === 200){
						let datas = res.data;
						this.teammsg = datas;
					}else{
						this.apifun.toast(res.msg)
					}
				})
			},
			usermsgfun(){
				let sendData = {};
				this.apifun.unirequest('/coach/user/getUserInfo','post',{},(res)=>{
					if(res.code === 200){
						let datas = res.data;
						uni.setStorageSync('usermsg', datas);
						this.usermsg = datas;
					}else{
						this.apifun.toast(res.msg)
					}
				})
			},
			navigate(urls,params){
				this.apifun.navigate(urls,params)
			},
			tabnavigate(urls){
				uni.switchTab({
					url:urls
				})
			}
		},
		onPullDownRefresh() {
			this.teamdatafun();
			uni.stopPullDownRefresh();
		},
	};
</script>

<style scoped lang="scss">
	.topblock{
		position:sticky;
		top:0px;
		z-index: 10;
		background: #fff;
		width: 100%;
		.topbg{
			position: absolute;
			top: 0;
			z-index: 10;
			width:100%;
			height: 640rpx;
		}
		.topmain{
			position:relative;
			top: 0;
			z-index: 50;
			width: 100%;
			.headmsg{
				width: 690rpx;
				padding: 30rpx 0;
				.headmsgavatar{
					position: relative;
					width: 140rpx;
					height: 140rpx;
					image{
						width: 140rpx;
						height: 140rpx;
					}
					.leader{
						position: absolute;
						bottom: -15rpx;
						width: 140rpx;
						height:36rpx;
						line-height: 36rpx;
						border-radius: 100rpx;
						text-align: center;
						font-size:24rpx;
					}
				}
				.headmsgmain{
					width: 75%;
					margin-left: 20rpx;
					.headmsgmt{
						margin-top:5rpx;
						.headmsgmt-name{
							font-size: 34rpx;
							color: #333333;
							font-weight: 600;
						}
						.headmsgmtx{
							height: 44rpx;
							border: 1px solid #0E71EB;
							margin-left: 20rpx;
							border-radius: 100rpx;
							background: #fff;
							.headmsgmtxl{
								padding:0 10rpx;
								border-radius: 100rpx;
								image{
									margin-top: 5rpx;
									width: 34rpx;
									height: 34rpx;
								}
							}
							.headmsgmtxr{
								padding: 0 20rpx;
								font-size:24rpx;
								line-height: 44rpx;
								color: #0E71EB;
							}
						}
					}
					.headmsgmphone{
						font-size: 28rpx;
						color: #333333;
						line-height:46rpx;
						padding: 10rpx 0;
					}
					.headmsgmtd{
						.headmsgmtdicon{
							width: 32rpx;
							height: 32rpx;
						}
						.headmsgmtdname{
							margin-left: 20rpx;
							color: #0E71EB;
							font-size:28rpx;
						}
					}
				}
			}
			.trainee{
				position: relative;
				z-index: 50;
				width: 690rpx;
				padding-top:20rpx;
				justify-content: space-around;
				.traineeeach{
					width: 40%;
					.traine-num{
						text-align: center;
						color:#333333;
						font-size: 40rpx;
						line-height: 50rpx;
					}
					.traine-tile{
						padding-top:10rpx;
						text-align: center;
						color:#333333;
						font-size:28rpx;
						line-height: 50rpx;
					}
				}
			}
			.order{
				position: relative;
				z-index: 50;
				width: 640rpx;
				padding: 20rpx 25rpx;
				background: #ffffff;
				border-radius: 20rpx;
				margin-top: 40rpx;
				.ordertop{
					justify-content: space-between;
					.ordertopl{
						margin-top: 10rpx;
						.ordertoplicon{
							width: 42rpx;
							height: 42rpx;
						}
						.ordertopltitle{
							font-size: 30rpx;
							color: #333333;
							font-weight: 600;
							margin-left: 10rpx;
							line-height: 42rpx;
						}
					}
					.ordertopr{
						color: #666666;
						font-size:24rpx;
						line-height: 60rpx;
					}
				}
				.ordermain{
					margin-top: 30rpx;
					justify-content: space-between;
					.traineeeach{
						width: 40%;
						.traine-num{
							text-align: center;
							color:#333333;
							font-size: 40rpx;
							line-height: 50rpx;
						}
						.traine-tile{
							padding-top:10rpx;
							text-align: center;
							color:#333333;
							font-size:28rpx;
							line-height: 50rpx;
						}
					}
				}
			}
		}
	}
	// 板块
	.coach{
		position: relative;
		z-index: 10;
		width: 640rpx;
		padding: 20rpx 25rpx;
		background: #ffffff;
		border-radius: 20rpx;
		margin-top: 20rpx;
		overflow: hidden;
		.ordertopic{
			position: absolute;
			left:-14rpx;
			top:38rpx;
			width: 28rpx;
			height: 28rpx;
			background: #0E71EB;
			border-radius: 50%;
		}
		.ordertop{
			justify-content: space-between;
			.ordertopl{
				margin-top: 10rpx;
				.ordertoplicon{
					width: 42rpx;
					height: 42rpx;
				}
				.ordertopltitle{
					font-size: 30rpx;
					color: #333333;
					font-weight: 600;
					margin-left: 10rpx;
					line-height: 42rpx;
					margin-left: 10rpx;
				}
			}
			.ordertopr{
				color: #666666;
				font-size:24rpx;
				line-height: 60rpx;
			}
		}
		.ordermain{
			margin-top: 30rpx;
			justify-content: space-between;
			.traineeeach{
				width: 25%;
				.traine-num{
					text-align: center;
					color:#333333;
					font-size: 40rpx;
					line-height: 50rpx;
				}
				.traine-tile{
					padding-top:10rpx;
					text-align: center;
					color:#333333;
					font-size:28rpx;
					line-height: 50rpx;
				}
			}
		}
	}
</style>